package di

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/business_opportunity"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/clue"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/common"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/message"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/subscription"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/controller/user"
)

func (c *Inject) InjectController() {
	controllers := []interface{}{
		business_opportunity.NewBidController,
		business_opportunity.NewContactController,
		business_opportunity.NewCustomerController,
		business_opportunity.NewProjectController,
		business_opportunity.NewSupplierController,
		business_opportunity.NewBuildingController,
		business_opportunity.NewLandController,
		clue.NewAnonymityController,
		clue.NewCustomerController,
		clue.NewClueManageController,
		clue.NewReportController,
		common.NewCommonController,
		common.NewFileController,
		common.NewMpController,
		common.NewOpenController,
		common.NewOptionController,
		message.NewVerifyCodeController,
		subscription.NewSubscriptionController,
		user.NewSyncUserController,
		user.NewUserController,
	}
	var errs []error
	for _, controller := range controllers {
		err := c.Provide(controller)
		if err != nil {
			errs = append(errs, err)
		}
	}
	fmt.Printf("InjectController #%+v\n", errs)
}
